﻿package components {
	
	import com.greensock.*;
	import com.greensock.easing.*;
	
	import flash.display.Graphics;
	import flash.display.MovieClip;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class ActivePanel extends MovieClip {
		
		private var _root:SphereClient;
		private var body:Sprite;
		
		private var activeTopicArray:Array = new Array(); 
		private var actTopCount:int = 0;
		
		public function ActivePanel(parentMC:SphereClient) {
			_root = parentMC;
			drawPanel();
		}
		
		private function drawPanel():void {

			//width = 200;
			//height = 200;
			x = 490;
			y = 50;
			
			
			graphics.lineStyle(1, 0xAAAAAA, 100);
			graphics.beginFill(0xFFFFFF);			
			graphics.drawRoundRect(0,0,100,300,20,20);
			graphics.endFill();
		}
		
		public function addTopic(topic:ActiveTopic):void {
			activeTopicArray.push(topic);
			//topic.x = -20;
			//topic.y = actTopCount*30;
			_root.addChild(topic);
			TweenLite.to(topic, 1, {x:this.x, y:this.y + actTopCount*40 + 15, ease:Back.easeOut});
			//TweenMax.to(topic,0,{blurFilter:{blurX:1, blurY:1}});
			//TweenMax.to(menuItem,0, {blurFilter:{blurX:1, blurY:1}});
			actTopCount++;
		}
		
		public function speachSelected(speachId:int):void{
			_root.speachSelected(speachId);
		}
	}	
}
